package com.letian.info.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.info.mapper.InfoUserFollowMapper;
import com.letian.info.domain.InfoUserFollow;
import com.letian.info.service.IInfoUserFollowService;

/**
 * 用户关注Service业务层处理
 * 
 * @author bmz
 * @date 2023-12-01
 */
@Service
public class InfoUserFollowServiceImpl implements IInfoUserFollowService 
{
    @Autowired
    private InfoUserFollowMapper infoUserFollowMapper;

    /**
     * 查询用户关注
     * 
     * @param userFollowId 用户关注主键
     * @return 用户关注
     */
    @Override
    public InfoUserFollow selectInfoUserFollowByUserFollowId(Long userFollowId)
    {
        return infoUserFollowMapper.selectInfoUserFollowByUserFollowId(userFollowId);
    }

    /**
     * 查询用户关注列表
     * 
     * @param infoUserFollow 用户关注
     * @return 用户关注
     */
    @Override
    public List<InfoUserFollow> selectInfoUserFollowList(InfoUserFollow infoUserFollow)
    {
        return infoUserFollowMapper.selectInfoUserFollowList(infoUserFollow);
    }

    /**
     * 新增用户关注
     * 
     * @param infoUserFollow 用户关注
     * @return 结果
     */
    @Override
    public int insertInfoUserFollow(InfoUserFollow infoUserFollow)
    {
        infoUserFollow.setCreateTime(DateUtils.getNowDate());
        return infoUserFollowMapper.insertInfoUserFollow(infoUserFollow);
    }

    /**
     * 修改用户关注
     * 
     * @param infoUserFollow 用户关注
     * @return 结果
     */
    @Override
    public int updateInfoUserFollow(InfoUserFollow infoUserFollow)
    {
        return infoUserFollowMapper.updateInfoUserFollow(infoUserFollow);
    }

    /**
     * 批量删除用户关注
     * 
     * @param userFollowIds 需要删除的用户关注主键
     * @return 结果
     */
    @Override
    public int deleteInfoUserFollowByUserFollowIds(Long[] userFollowIds)
    {
        return infoUserFollowMapper.deleteInfoUserFollowByUserFollowIds(userFollowIds);
    }

    /**
     * 删除用户关注信息
     * 
     * @param userFollowId 用户关注主键
     * @return 结果
     */
    @Override
    public int deleteInfoUserFollowByUserFollowId(Long userFollowId)
    {
        return infoUserFollowMapper.deleteInfoUserFollowByUserFollowId(userFollowId);
    }
}
